<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>泉城投票</title>
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />  
    <meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="/css/vote/unregister/dp.css">
	<script src="/js/admin/jquery.min.js"></script>

</head>
<body>
	<div id="main">
		<h1 class="title">
			<span>
				
			</span>
		</h1>
		<div class="con">
			<div class="left">
				<div class="leftBox">
					<div class="voteBg">
					</div>
					<h2>县区排名</h2>
				</div>
			</div>
			<div class="middle">
				<ul>
					@foreach($data as $key=>$item)
						<li><p>{{$item['title']}}</p></li>
					@endforeach
				</ul>
			</div>
			<div class="right">
				 <ul id="progressBoxWrap">
					 @foreach($data as $key=>$item)
						 <li>
						 <p class="progressBox"><span class="progress progress{{$key}}" data-ratio="{{$data[$key]['ratio']}}"></span></p>
							 <span class="num">{{$item['voteNumber']}}</span>
						 </li>
				 	@endforeach
				</ul>
			</div>
		</div>
	</div>
	<script>
	$(function(){
		var date =  new Date().format('yyyy年MM月dd日');
		$('.nowDate').html(date);
			setTimeout(function(){
                $('#progressBoxWrap .progress').each(function () {
                    var ratio = $(this).data('ratio');
                    $(this).css({
                        'width': ratio+"%",
                        'opacity': 1
                    })
                });
			},300);

			$('.title').click(function(){
				location.reload();
			})
	});

	Date.prototype.format = function(format) {
       var date = {
              "M+": this.getMonth() + 1,
              "d+": this.getDate(),
              "h+": this.getHours(),
              "m+": this.getMinutes(),
              "s+": this.getSeconds(),
              "q+": Math.floor((this.getMonth() + 3) / 3),
              "S+": this.getMilliseconds()
       };
       if (/(y+)/i.test(format)) {
              format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
       }
       for (var k in date) {
              if (new RegExp("(" + k + ")").test(format)) {
                     format = format.replace(RegExp.$1, RegExp.$1.length == 1
                            ? date[k] : ("00" + date[k]).substr(("" + date[k]).length));
              }
       }
       return format;
	};

    //刷新页面
    setInterval(function () {
        window.location.reload(true);
    },1000*300);
		
	</script>
</body>
</html>